home *** CD-ROM | disk | FTP | other *** search
/ TeX 1995 July / TeX CD-ROM July 1995 (Disc 1)(Walnut Creek)(1995).ISO / macros / tip / orcards.tip < prev    next >
Text File  |  1993-09-15  |  3KB  |  120 lines

  1. % This macro source file is from the four volume series
  2. % "TeX in Practice" by Stephan von Bechtolsheim, published
  3. % 1993 by Springer-Verlag, New York.
  4. % Copyright 1993 Stephan von Bechtolsheim.
  5. % No warranty or liability is assumed.
  6. % This macro may be copied freely if no fees other than
  7. % media cost or shipping charges are charged and as long
  8. % as this copyright and the following source code itself
  9. % is not changed. Please see the series for further information.
  10. %
  11. % Version: 1.0
  12. % Date: May 1, 1993
  13. %
  14. %
  15. % This source code is documented in 34.5.1, p. IV-70.
  16. % Original source in file "o1.TEX", starting line 532.
  17. \wlog{L: "orcards.tip" ["o1.TEX," l. 532, p. IV-70]}%
  18. % This file DOES NOT belong to format "texip."
  19. \InputD{box-mac.tip}
  20. \InputD{modonead.tip}
  21. \InputD{nlm.tip}
  22. \hsize = 3.0in
  23. \baselineskip = 12pt
  24. \topskip = 10pt plus 10pt
  25. \vsize = 9\baselineskip
  26. \countdef\PageNo = 0
  27. \newcount\CardCount
  28. \CardCount = 0
  29. \def\Card #1{% 
  30.     \vfill\eject
  31.     \advance\CardCount by 1
  32.     \noindent
  33.     {\bf #1}
  34.     \par
  35.     \def\CardTitle{#1}%
  36. }
  37. \newdimen\RuleSpace     \RuleSpace = 10pt
  38. \newdimen\BetweenRules  \BetweenRules = 20pt
  39. \newdimen\BaseLineSkipSave
  40. \BaseLineSkipSave = \baselineskip
  41. \newcount\PositionCount
  42. \PositionCount = 0
  43. \def\HeadLine{%
  44.     \line{%
  45.         \strut
  46.         {\it Cards, page \the\PageNo}% 
  47.         \hfil
  48.         \tt\jobname
  49.     }% 
  50. }
  51. \def\FootLine{%
  52.     \line{\strut*****\hfil*****}% 
  53. }
  54. \newbox\OutTopBox
  55. \newbox\OutMidBox
  56. \newbox\OutBotBox
  57. \def\CardOutputRoutine{%
  58.     \NewLineMessage{\string\CardOutputRoutine:
  59.         card number: \the\CardCount,
  60.         PositionCounter: \the\PositionCount,}%
  61.     \NewLineMessage{page number: \the\PageNo,
  62.         \string\outputpenalty: \the\outputpenalty.}%
  63.     \ifnum\outputpenalty < -9999
  64.         \setbox0 = \hbox{\strut}
  65.     \else
  66.         \setbox0 = \line{%
  67.             \strut
  68.             \hfil
  69.             \it
  70.             \CardTitle\space con't\/\dots
  71.         }%
  72.     \fi
  73.     \setbox 2 = \vbox{%
  74.         \offinterlineskip
  75.         \hrule
  76.         \vskip\RuleSpace
  77.         \VboxR to \vsize{\unvbox 255 \vfill}
  78.         \box0
  79.         \vskip\RuleSpace
  80.         \hrule
  81.     }
  82.     \global\setbox
  83.         \ifcase\PositionCount
  84.             \OutTopBox \or
  85.             \OutMidBox \or
  86.             \OutBotBox
  87.         \fi
  88.         = \box2
  89.     \ifnum\PositionCount = 2
  90.         \shipout\vbox{%
  91.             \offinterlineskip
  92.             \VboxR{
  93.                 \HeadLine
  94.                 \vskip\BaseLineSkipSave
  95.  
  96.                 \box\OutTopBox
  97.                 \vskip\BetweenRules
  98.                 \box\OutMidBox
  99.                 \vskip\BetweenRules
  100.                 \box\OutBotBox
  101.  
  102.                 \vskip\BaseLineSkipSave
  103.                 \FootLine
  104.             }
  105.         }
  106.     \fi
  107.     \ifnum\outputpenalty = -20000
  108.         \NewLineMessage{\string\supereject\space encountered.}
  109.         \ifnum\PositionCount < 2
  110.             \line{}
  111.             \vfill
  112.             \supereject
  113.         \fi
  114.     \fi
  115.     \ifnum\ModuloOneAdvanceNumCond{\PositionCount}{3} = 0 
  116.         \global\advance\pageno by 1
  117.     \fi
  118. }
  119. \output = {\CardOutputRoutine}
  120.